Ruby program to create a block using curly braces {}
arr = Array(1..5);
puts "Array Elements: "
arr.each {|val| print val," ";}
Output:
Array Elements:
1 2 3 4 5
arr = Array(1..5);
puts "Array Elements: "
arr.each {|val| print val," ";}
Output:
Array Elements:
1 2 3 4 5